package com.imooc.sell.enums;

import lombok.Getter;

/**
 * 返回给前端提示的消息
 */
@Getter
public enum ResultEnum {
  //小写转大写 ctrl + shift + u
  PARAMS_ERROR(0, "参数错误"),
  //商品
  PRODUCT_NOT_EXIST(10, "商品不存在"),
  PRODUCT_STOCK_EMPTY(11, "库存不足"),


  //订单
  ORDER_NOT_EXIST(12, "订单不存在"),
  ORDER_DETAIL_NOT_EXIST(13, "订单详情不存在"),
  ORDER_STATUS_DONE(14, "订单已完成，或订单已经被取消！"),
  ORDER_DETAIL_EMPTY(15, "订单详情为空"),
  ORDER_CANCEL_ERROR(16, "取消订单失败"),
  ORDER_PAY_ERROR(17, "订单不能被支付"),
  ORDER_STATUS_UPDATE_ERROR(18, "订单状态更新失败"),
  CART_EMPTY(19, "购物车不能为空"),
  ORDER_ID_NOT_NULL(20, "订单id不能为空");

  private Integer code;
  private String msg;

  ResultEnum(Integer code, String msg) {
    this.code = code;
    this.msg = msg;
  }
}
